#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

char* addBinary(char* a, char* b)
{
    int sum_a = 0;
    int sum_b = 0;
    int sum = 0;

    for (int i = strlen(a) - 1; i > 0; i--)
    {
        sum_a = sum_a + a[i] * 2 ^ a[i];
    }
    for (int i = strlen(b) - 1; i > 0; i--)
    {
        sum_b = sum_b + b[i] * 2 ^ b[i];
    }
    sum = sum_a + sum_b;

    char c[100];

    for (int i = 0; i < strlen(a) + strlen(b); i++)
    {
        c[i] = sum % 2;
    }
    return c;
}

int main()
{

    int a[3] = { 1,0,0 };
    int b[1] = { 1 };

    addBinary(a, b);

    printf("%s", addBinary(a, b));

    return 0;
}